package ITSBank;

/**
 * This class represents a transaction (like the paper from the bank [Überweisungsschein])
 *
 *
 * @author Benedikt Gschossmann
 */

/**
     * Constructor of class Transaction
     *
     * @param sourceAcc
     * @param destAccount
     * @param curAmount
     * @param curType
     * @param curPIN
     */
public class Transaction {
    private Bank bankID;
    private int AccountID;
    //private int foreignAccountID;
    //private Bank foreignBank;
    private float amount;
    private String type;

/*
 *Pawel: I removed destAccount, because not every transaction is made with 2 accounts
 *(deposti and withdraw use only one). Also PIN is not necessary. For a transaction
 * its just important to which account it belongs, what type was it, and what was the
 * amount of money for this trans.
 * Maybe it's a good idea to add a String variable to keep some additional info.
 *
 */
    Transaction(Account account, String type, float amount){
        bankID = account.getBankID();
        AccountID = account.getAccountNumber();
        //foreignAccountID = destAccount.getAccountNumber();
        //foreignBank = destAccount.getBankID();
        this.amount = amount;
        this.type = type;
    }
    /**
     * Get-method for bankID
     * @return ID of bank of initiator of the transaction
     */
    public Bank getBank () {
        return bankID;
    }

    /**
     * Get-method for accID
     * @return ID of account of initiator of the transaction
     */
    public int getAccID () {
        return AccountID;
    }

    /**
     * Get-method for foreignAccID
     * @return ID of the destination account
     */
  /*  public int getForeignAccID () {
        return foreignAccountID;
    }*/

    /**
     * Get-method for foreignBankID
     * @return ID of the destination accounts bank
     */
    /*public Bank getForeignBankID () {
        return foreignBank;
    }*/

    /**
     * Get-method for type
     * @return type of the transaction (f.e. immediately, foreign country, ...)
     */
    public String getType () {
        return type;
    }

    /**
     * Get-method for amount
     * @return amount of money, transfered vie this transaction
     */
    public float getAmount () {
        return amount;
    }

    public void displayTransaction(){
        System.out.println("BankID: "+this.getBank().getBankName());
        System.out.println("AccountNumber: "+this.getAccID());
        System.out.println("Trans. type: "+this.getType());
        System.out.println("Trans. Amount: "+this.getAmount());
    }
    
}

